import Vuex from 'vuex'

import Vue from 'vue'

import * as mutationsTypes from './mutationsTypes'
Vue.use(Vuex)

const state = () => ({
  showLoading: false
})

const getters = {}
const mutations = {
  // 修改加载状态
  [mutationsTypes.CHANGE_LOADING_STATE](state, flag) {
    state.showLoading = flag
  }
}
const actions = {}
const modules = {}
const store = new Vuex.Store({
  state,
  getters,
  mutations,
  actions,
  modules
})

export default store
